import asyncio

async def fun1():
    print(1)
    await asyncio.sleep(2)
    print(2)

async def fun2():
    print(3)
    await asyncio.sleep(2)
    print(4)

if __name__ == "__main__":
  tasks = [
    asyncio.ensure_future(fun1()),
    asyncio.ensure_future(fun2())
  ]
  loop = asyncio.get_event_loop()
  loop.run_until_complete(asyncio.wait(tasks))